<template>
	<view class="grid-columns-2 gap-8">
		<view class=" round-8 overflow-hidden h-250  relative text-white " v-for="(detail,index) in list"
			:key='detail.id'>
			<view class="w-p-100 flex flex-center h-p-100 flex-column gap-8 bg-white" v-if="detail.status==1">
				<y-loading></y-loading>
				<text class="fs-12 text-666">创建中...</text>
			</view>
			<image v-if="detail.status==3" src="/static/image/loading.png" class="round-8 w-p-100 h-p-100"></image>
			<image v-if="detail.status==2" show-menu-by-longpress :src="detail?.result" class="round-8 w-p-100 h-p-100"
				@click="preview(detail.result)"></image>
			<view class="absolute bottom-0 left-0 right-0 px-10 py-6 bg">
				<view class="flex flex-x-space-between flex-y-center">
					<text class="fs-12">{{detail.create_time}}</text>
					<text class="iconfont icon-gengduo text-white" @click="emit('more',detail)"></text>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	const props = defineProps({
		list: {
			type: [Object, Array],
			default: []
		}
	})
	const emit = defineEmits(['more'])

	const preview = (e) => {
		uni.previewImage({
			urls: [e]
		})
	}
</script>

<style scoped>
	.bg {
		background: rgba(0, 0, 0, 0.5);
		backdrop-filter: blur(10px);
	}
</style>